<?php

header("Access-Control-Allow-Origin: *");
//模糊地址查询
include_once '../../library/config.php';
include_once '../../model/gponfenguangqilist.php';
include_once '../../model/gponuserlist.php';

$entity = new GponFenGuangQi();
$list = new GponFenGuangQi();
$entity->request();


try {

    $place = $entity['place'];
    $entity->select('name')->where("place='" . $place . "'")->orderby("name asc")->query();
    $arr = array();
    $entity->remove(array('id'));
    while ($entity->for_in_rows()) {
        $list->select('name,marching2,simultaneous,property,remark1,remark2')->where("place='" . $place . "' and name='" . $entity['name'] . "'")->get_first_rows();
        array_push($arr, [
            "name" => $entity['name'],
            "marching2" => $list['marching2'],
            "simultaneous" => $list['simultaneous'],
            "property" => $list['property'],
            "remark1" => $list['remark1'],
            "remark2" => $list['remark2']
                ]
        );
    }
    echo json_encode($arr);
} catch (Exception $exc) {
    echo $entity->rsscode($exc);
}